#include <iostream>   //三种构造函数、虚析构函数与多态的结合应用举例
#include "BaseClass.h"
#include "SonClass.h"
#include "GrandsonClass.h"

int main(int argc, char *argv[])
{
//    BaseClass*c1 = new DerivedClass(); //多态性
    BaseClass*c2 = new GrandsonClass();  //直接父类到孙类
//    c1->func();
    c2->func();
    BaseClass* c3 = c2;  //对于赋值构造函数时用
    c3->func();
//    delete c1;
    delete c2;
    delete c3;
    return 0;
}
